//
//  NetworkTools.m
//  oc网络请求封装
//
//  Created by Apple on 16/12/1.
//  Copyright © 2016年 Apple. All rights reserved.
//

#import "ZSContentNetworkTools.h"

@implementation ZSContentNetworkTools

+ (instancetype)sharedTools {
    static ZSContentNetworkTools *tools;
    static dispatch_once_t onceToken;
    dispatch_once(&onceToken, ^{
        tools = [[ZSContentNetworkTools alloc] init];
        //  在原有的基础上追加一项可接受的数据响应类型
        tools.responseSerializer.acceptableContentTypes = [tools.responseSerializer.acceptableContentTypes setByAddingObject:@"text/html"];
    });

    return tools;
}

- (void)getContentResultWithBlock:(result)finishBlock{
    NSString *urlStr = @"http://l68.vip/show/75.html";
      [self POST:urlStr parameters:nil progress:nil success:^(NSURLSessionDataTask * _Nonnull task, id  _Nullable responseObject) {
            NSDictionary *result = responseObject;
            finishBlock(YES,result);
        } failure:^(NSURLSessionDataTask * _Nullable task, NSError * _Nonnull error) {
             finishBlock(NO,@"请求失败");
        }];
    }



@end
